package com.he.DesignPatterns.command;

import java.util.ArrayList;
import java.util.List;

/**
 * @description: 命令类
 * @Author: HCL
 * @Date: 2024/9/27 14:38
 */
public class Broker {

    List<Order> orderList = new ArrayList<>();

    public void takeOrder(Order order) {
        orderList.add(order);
    }

    public void placeOrders() {
        orderList.forEach(
                o -> o.execute()
        );
//        orderList.clear();
    }
}
